package com.weasel.weixin.commons.message.builder.initiative;

import com.weasel.weixin.commons.message.bean.initiative.ImageCustomInitiativeMessage;

/**
 * Created by Dylan on 2015/10/19.
 */
public class ImageCustomInitiativeMessageBuilder extends AbstractCustomInitiativeMessageBuilder<ImageCustomInitiativeMessageBuilder,ImageCustomInitiativeMessage> {

    public ImageCustomInitiativeMessageBuilder() {
        super(new ImageCustomInitiativeMessage());
    }

    public ImageCustomInitiativeMessageBuilder mediaId(String mediaId){

        getImage().setMediaId(mediaId);
        return this;
    }

    private ImageCustomInitiativeMessage.Image getImage(){

        ImageCustomInitiativeMessage.Image image = ((ImageCustomInitiativeMessage)message).getImage();
        if(null == image){
            image = new ImageCustomInitiativeMessage.Image();
            ((ImageCustomInitiativeMessage) message).setImage(image);
        }
        return image;
    }

}
